function CalendarHeaderStatus(firstVisibleYearMonth, selectedYearMonth) {
    this.firstVisibleYearMonth = firstVisibleYearMonth;
    this.selectedYearMonth = selectedYearMonth;
}

CalendarHeaderStatus.prototype = {
    isSameWith: function(other) {
        return other &&
                this.firstVisibleYearMonth.isSameWith(other) &&
                this.selectedYearMonth.isSameWith(other);
    },
  
    shiftYears: function(years) {
        this.firstVisibleYearMonth = this.firstVisibleYearMonth.addMonths(years * 12);
        this.selectedYearMonth = this.selectedYearMonth.addMonths(years * 12);
    },

    shiftMonths: function(months) {
        var oldSelectedYearMonth = this.selectedYearMonth;

        var firstVisibleYearMonth = this.firstVisibleYearMonth.addMonths(months);
        var lastVisibleYearMonth = firstVisibleYearMonth.addMonths(11);
        var selectedYearMonth = oldSelectedYearMonth.isEarlierThan(firstVisibleYearMonth) ? firstVisibleYearMonth
                : oldSelectedYearMonth.isLaterThan(lastVisibleYearMonth) ? lastVisibleYearMonth
                : oldSelectedYearMonth;
        this.firstVisibleYearMonth = firstVisibleYearMonth;
        this.selectedYearMonth = selectedYearMonth;
    },

    getYearMonthsInRange: function() {
        var yearMonths = [];
        for (var i = 0; i < 12; i++) {
            yearMonths.push(this.firstVisibleYearMonth.addMonths(i));
        }
        return yearMonths;
    },

    getShowingDateRange: function(){
        var firstDay = this.firstVisibleYearMonth.firstDayOfMonth();
        var lastDay = this.firstVisibleYearMonth.addMonths(11).lastDayOfMonth();
        return new DateRange(firstDay, lastDay);
    }
};